//
//  MerchantModel.m
//  ImGuider
//
//  Created by 李陆涛 on 2018/6/12.
//  Copyright © 2018年 imguider. All rights reserved.
//

#import "MerchantModel.h"

@implementation MerchantEventModel

@end

@implementation MerchantModel

+ (NSDictionary *)modelCustomPropertyMapper {
    
    return @{@"mid" : @"id",@"website":@"detail.website",@"tel":@"detail.tel",@"opentime":@"detail.opentime",@"playpath":@"detail.music.url"};
}

+ (NSDictionary *)modelContainerPropertyGenericClass {
    
    return @{@"business" : [MerchantModel class],@"promotion":[MerchantEventModel class]};
}

- (NSString *)smartName {
    
    if (self.name.length > 0) {
        return self.name;
    }
    
    return self.shop_name.length > 0 ? self.shop_name : self.restaurant_name;
}

- (NSString *)smartIntro {
    
    if (self.intro.length > 0) {
        return self.intro;
    }
    
    return self.shop_desc.length > 0 ? self.shop_desc : self.restaurant_desc;
}

- (NSArray *)tagsArray {
    
    return [self.tags componentsSeparatedByString:@","];
}

- (NSArray *)pictureArray {
    
    return [self.pictures componentsSeparatedByString:@","];
}


@end
